{if $paginate.total > 0 && $paginate.current_item <= $paginate.total}
	<div class="center">
		{include file="general/pagination_item_range.tpl"}
	</div>
	<br />
{/if}
{foreach $published_urls as $published_url}
	<h1>
		{if $published_url.keyword}
			{capture name="tiny_url"}{get_scheme()}://{if $published_url.domain}{$published_url.domain}{else}{#RewriteHost#}{/if}/{$published_url.keyword}{/capture}
			<a href="{$smarty.capture.tiny_url}" rel="external">{$published_url.title}</a>
		{else}
			{$published_url.title}
		{/if}
	</h1>
	<div class="float-left"><i>posted {if $published_url.username}by {$published_url.username} {/if}on {$published_url.date}</i></div>
	<div class="float-right align-right">
		<a href="url_comment_add.php?id={$published_url.id}">{$published_url.nb_comments} comment{if $published_url.nb_comments > 1}s{/if}</a>
		<div class="rating">
			<b>Rate this URL</b><br /><br />
			{if $published_url.nb_ratings > 0}
				{$published_url.nb_ratings} rating{if $published_url.nb_ratings > 1}s{/if}<br />
				{$published_url.avg_ratings} out of 5<br /><br />
			{else}
				No rating yet<br /><br />
			{/if}
			{if $user_authenticated}
				{if !in_array($published_url.id, $voted)}
					<form action="" method="post">
						<table class="rating">
							<tr>
								<td><input type="radio" name="rating" value="1" /></td>
								<td><input type="radio" name="rating" value="2" /></td>
								<td><input type="radio" name="rating" value="3" /></td>
								<td><input type="radio" name="rating" value="4" /></td>
								<td><input type="radio" name="rating" value="5" /></td>
							</tr>
							<tr>
								<td>1</td>
								<td>2</td>
								<td>3</td>
								<td>4</td>
								<td>5</td>
							</tr>
						</table>
						<div>
							<input type="hidden" name="id" value="{$published_url.id}" />
							<input type="submit" name="vote_button" value="Vote" />
						</div>
					</form>
				{else}
					<div>You have<br />already voted<br />for this URL.</div>
				{/if}
			{else}
				<div>You must be<br />logged in to vote<br />for this URL.</div>
			{/if}
		</div>
	</div>
	<p class="content-rating">{$published_url.content|nl2br}</p>
	<div class="clear"></div>
{foreachelse}
	<p class="center">No published URLs matches found in the database.</p>
{/foreach}
{if $published_url@show}
	<br />
	<div class="center">
		{include file="general/pagination_page_number.tpl"}
	</div>
{/if}